home *** CD-ROM | disk | FTP | other *** search
/ Leonardo the Inventor / Leonardo The Inventor (93026)(Broderbund)(Riverdeep)(2004).iso / LEOWINMV / SHARED.DIR / 03106_Script_MAC PRINT LEO II < prev    next >
Text File  |  1996-04-01  |  4KB  |  136 lines

  1. -- --------------------------------------------------------------------------------------
  2. -- Handler printScreenMAC prints a screenShot of the current 13" screen
  3. -- (640 wide by 480 tall), scaled up to fit an 11 x 8.5 inch page...
  4. -- (not recommended for monitors/windows smaller than 640 x 480 at this time)
  5. -- If printSize is "card", it prints 4 cards on the page. Otherwise, it prints
  6. -- on screenshot.
  7.  
  8. on printScreenMAC printSize
  9.   if (printSize = "card") then
  10.     printCardSizeMac
  11.   else if (printSize = "full") then
  12.     printFullSizeMAC
  13.   end if
  14. end
  15.  
  16. -- --------------------------------------------------------------------------------------
  17. -- Handler printFullSizeMAC prints the curren screen in landscape form.
  18.  
  19. on printFullSizeMAC fullFileName
  20.   -- 1) open the xobject
  21.   openXObjHandler "PMATIC.XOBJ"
  22.   
  23.   -- 2) create a new object
  24.   set printObj = printomatic(mnew)
  25.   
  26.   if not(objectP( printObj )) then
  27.     alert "Sorry...Error in printing."
  28.     exit
  29.   end if
  30.   
  31.   -- 3) call the print function to print
  32.   doPrintFullScreen(printObj, fullFileName)
  33.   
  34.   -- 4) close the xojbect
  35.   closeXObjHandler "PMATIC.XOBJ"
  36. end
  37.  
  38. -- --------------------------------------------------------------------------------------
  39. -- Handler printFileMAC 
  40.  
  41. on printFileMAC printSize, fullFileName
  42.   if (printSize = "card") then
  43.     printCardSizeMac(fullFileName)
  44.   else if (printSize = "full") then
  45.     printFullSizeMAC(fullFileName)
  46.   end if
  47. end
  48.  
  49. -- --------------------------------------------------------------------------------------
  50. -- Handler printAllCardsMAC 
  51.  
  52. on printAllCardsMAC filePathName
  53.   -- 1) open the xobject
  54.   openXObjHandler "PMATIC.XOBJ"
  55.   
  56.   -- 2) call the printing function (this one creates and disposes)
  57.   doPrintAllCards(filePathName)
  58.   
  59.   -- 3) close the xojbect
  60.   closeXObjHandler "PMATIC.XOBJ"
  61. end
  62.  
  63. -- --------------------------------------------------------------------------------------
  64. -- Handler printPictureMAC 
  65.  
  66. on printPictureMAC printSize, whichCast, title, caption
  67.   -- 1) open the xobject
  68.   openXObjHandler "PMATIC.XOBJ"
  69.   
  70.   -- 2) create a new object
  71.   set printObj = printomatic(mnew)
  72.   
  73.   if not(objectP( printObj )) then
  74.     alert "Leo 2 - Problem opening XObject"
  75.     exit
  76.   end if
  77.   
  78.   -- 3) call the print function to print
  79.   doPrintPicture(printObj, whichCast, title, caption) 
  80.   
  81.   -- 4) close the xojbect
  82.   closeXObjHandler "PMATIC.XOBJ"
  83. end
  84.  
  85. -- ----------------------------------------------------------------
  86. -- Handler printDatabaseMAC is called when the user clicks the print
  87. -- button in the database. It prints the text or picture (whichever
  88. -- is currently displayed) of the currently selected topic.
  89.  
  90. on printDatabaseMAC
  91.   global textButton, pictureButton
  92.   
  93.   -- 1) open the xobject
  94.   openXObjHandler "PMATIC.XOBJ"
  95.   
  96.   -- 2) create a new object
  97.   set printObj = printomatic(mnew)
  98.   
  99.   if not(objectP( printObj )) then
  100.     alert "Sorry...Error in printing."
  101.     exit
  102.   end if
  103.   
  104.   -- 3) call the print function to print
  105.   if isActivated(textButton) then
  106.     doPrintDatabaseText(printObj)
  107.   else if isActivated(pictureButton) then
  108.     doPrintDatabasePicture(printObj)
  109.   end if
  110.   
  111.   -- 4) close the xojbect
  112.   closeXObjHandler "PMATIC.XOBJ"
  113. end
  114.  
  115. -- -----------------------------------------------------------
  116. -- Handler printCardSizeMac prints four of the current screen on a 
  117. -- landscape page.
  118.  
  119. on printCardSizeMac fullFileName
  120.   -- 1) open the xobject
  121.   openXObjHandler "PMATIC.XOBJ"
  122.   
  123.   -- 2) create a new object
  124.   set printObj = printomatic(mnew)
  125.   
  126.   if not(objectP( printObj )) then
  127.     alert "Sorry...Error in printing."
  128.     exit
  129.   end if
  130.   
  131.   -- 3) call the print function to print
  132.   doPrintCardSize(printobj, fullFileName)
  133.   
  134.   -- 4) close the xojbect
  135.   closeXObjHandler "PMATIC.XOBJ"
  136. end